using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace TextSupport
{
	public class BitmapSurface : TextSupport.IEditSurface
	{
		public BitmapSurface(int width, int height)
		{
			_bm = new Bitmap(width, height);
			_extent = new Rectangle(0, 0, width, height);
		}

		public BitmapSurface()
		{
			_bm = new Bitmap(320, 200);
			_extent = new Rectangle(0, 0, 320, 200);
		}

		Bitmap _bm;
		RectangleF _extent;
		Font _font = new Font("Arial", 12);

		#region IEditSurface Members

		public System.Drawing.RectangleF GetExtent()
		{
			return _extent;
		}

		public System.Drawing.Graphics GetGraphics()
		{
			return Graphics.FromImage(_bm);
		}

		public Font GetDefaultFont()
		{
			return _font;
		}

		public void Invalidate()
		{
			// do nothing
		}

		public void Invalidate(System.Drawing.RectangleF rect)
		{
			// do nothing
		}

		public void RestartCaretTimer()
		{
			// do nothing
		}

		#endregion
}
}
